package com.best.oasis.settlement.util
{
	public class DateUtils
	{
		public function DateUtils()
		{
		}
		public static function dateAdd(datepart:String="", number:Number=0, date:Date=null):Date 
		{ 
			if (date == null) 
			{ 
				date=new Date(); 
			} 
			
			var returnDate:Date=new Date(date.time); 
			switch (datepart.toLowerCase()) 
			{ 
				case "fullyear": 
				case "month": 
				case "date": 
				case "hours": 
				case "minutes": 
				case "seconds": 
				case "milliseconds": 
					returnDate[datepart]+=number; 
					break; 
				default: 
					break; 
			} 
			var newdate:Date=new Date(returnDate.getFullYear(), returnDate.getMonth(), returnDate.date - 1); 
			return newdate; 
		} 
		public static function getDate(value:Date):Date
		{
			return new Date(value.getFullYear(), value.getMonth(), value.getDate());
		}
	}
}